package com.zy.algorithm.v3

import com.zy.activity.BaseMenuActivity
import com.zy.activity.bean.BaseMenuBean
import com.zy.algorithm.v3.sort.ShowAllPointFragment
import com.zy.algorithm.v3.sort.HeapSortFragment
import com.zy.algorithm.v3.sort.BucketSortFragment
import com.zy.algorithm.v3.sort.RadixSortFragment
import com.zy.algorithm.v3.sort.CountSortFragment
import com.zy.algorithm.v3.sort.MergeSortFragment
import com.zy.algorithm.v3.sort.QuickSortFragment
import com.zy.algorithm.v3.sort.BubbleSortFragment
import android.content.Intent
import java.util.ArrayList

internal class AlgorithmV3SortActivity : BaseMenuActivity() {

    override fun init(list: ArrayList<BaseMenuBean>) {
        list.add(BaseMenuBean("排序算法"))
        list.add(BaseMenuBean("Node 展示", ShowAllPointFragment::class.java))
        list.add(BaseMenuBean("10.堆排序", HeapSortFragment::class.java))
        list.add(BaseMenuBean("10.堆排序(构建二叉堆)", HeapSortFragment::class.java))
        list.add(BaseMenuBean("9.桶排序", BucketSortFragment::class.java))
        list.add(BaseMenuBean("8.基数排序(固定)", RadixSortFragment::class.java, 1))
        list.add(BaseMenuBean("8.基数排序", RadixSortFragment::class.java))
        list.add(BaseMenuBean("7.计数排序(固定)", CountSortFragment::class.java, 1))
        list.add(BaseMenuBean("7.计数排序", CountSortFragment::class.java))
        list.add(BaseMenuBean("6.归并排序", MergeSortFragment::class.java))
        list.add(BaseMenuBean("5.快速排序", QuickSortFragment::class.java))
        list.add(BaseMenuBean("4.希尔排序", BubbleSortFragment::class.java))
        list.add(BaseMenuBean("3.插入排序", BubbleSortFragment::class.java))
        list.add(BaseMenuBean("2.选择排序", BubbleSortFragment::class.java))
        list.add(BaseMenuBean("1.冒泡排序", BubbleSortFragment::class.java))
    }

    override fun clickItem(bean: BaseMenuBean) {
        val intent = Intent(this, AlgorithmV3MainActivity::class.java)
        intent.putExtra("code", bean.code)
        intent.putExtra("targetClass", bean.targetClass)
        startActivity(intent)
    }
}